package com.powernode.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.powernode.domain.Customer;
import com.powernode.dto.VisitLogDto;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.powernode.domain.VisitLog;
import com.powernode.mapper.VisitLogMapper;
import com.powernode.service.VisitLogService;

import java.util.List;

/**
 *描述：
 *作者：丁鹏
 */
@Service
public class VisitLogServiceImpl implements VisitLogService{

    @Resource
    private VisitLogMapper visitLogMapper;

    @Override
    public int insert(VisitLog record) {
        return visitLogMapper.insert(record);
    }

    @Override
    public int insertSelective(VisitLog record) {
        return visitLogMapper.insertSelective(record);
    }

    @Override
    public Page<VisitLog> queryForPage(VisitLogDto visitLogDto) {
        Page<VisitLog> page= PageHelper.startPage(visitLogDto.getPage(),visitLogDto.getLimit());
        List<VisitLog> visitLogList=this.visitLogMapper.queryAllVisitLog(visitLogDto.getCustomerId());
        return page;
    }

}